#ifndef __PICTUREPUZZLELAYER_SCENE_H__
#define __PICTUREPUZZLELAYER_SCENE_H__

#include "cocos2d.h"  
#include "..\cocos2d\extensions\cocos-ext.h"
#include "cocos\ui\CocosGUI.h"
#include "PuzzleGuess.h"
#include "PictureItem.h"
#include "PictureItemCell.h"
 

NS_GAME_BEGIN
				  
class PicturePuzzleLayer :
	public cocos2d::Layer 
{
protected:
	cocos2d::extension::ScrollView *scroll; 
	cocos2d::ui::Layout *pageLayout;
	com::belyn::game::puzzleGuess::PictureItemCell* pictureContent;
public:

	void onKeyPressed(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event) override;
    void onKeyReleased(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event) override;

	// there's no 'id' in cpp, so we recommend returning the class instance pointer
	static cocos2d::Scene* createScene(PictureItem &selectedPictureItem);

	// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
	virtual bool init(PictureItem &selectedPictureItem);    
	// implement the "static create()" method manually
	static PicturePuzzleLayer* create(PictureItem &selectedPictureItem) 
	{ 
		PicturePuzzleLayer *pRet = new PicturePuzzleLayer(); 
		if (pRet && pRet->init(selectedPictureItem)) 
		{ 
			pRet->autorelease(); 
			return pRet; 
		} 
		else 
		{ 
			delete pRet; 
			pRet = NULL; 
			return NULL; 
		} 
	}
	  
	 
}; 

NS_GAME_END

#endif	//__PICTUREPUZZLELAYER_SCENE_H__